package br.com.lh.urabuilder.domain.xml
{
	import br.com.lh.urabuilder.util.ValidatorFactory;
	
	import mx.collections.ArrayCollection;
	import mx.resources.ResourceManager;
	
	public class WSAction extends ConditionalAction
	{
		
		public var url:UraActionField = new UraActionField(
		ValidatorFactory.getRequiredValidator(ValidatorFactory.STRING_VALIDATOR,200),
		ResourceManager.getInstance().getString('messages','ura.components.url'));
		
		public var method:UraActionField = new UraActionField(null,
		ResourceManager.getInstance().getString('messages','ura.components.method'),
		"GET",
		new ArrayCollection(["GET","POST","PUT","DELETE"]));
		
		public var content:UraActionField = 
		new UraActionField(ValidatorFactory.unlimitedStringValidator,
		ResourceManager.getInstance().getString('messages','ura.components.content')
		);
		
		public var variable:UraActionField = new 
		UraActionField(ValidatorFactory.getValidator(ValidatorFactory.STRING_VALIDATOR,20,false)
		,ResourceManager.getInstance().getString('messages','ura.components.wsvariable')
		);
		
		public var filterPath:UraActionField = new 
		UraActionField(ValidatorFactory.getValidator(ValidatorFactory.STRING_VALIDATOR,50,false),
		ResourceManager.getInstance().getString('messages','ura.components.filter')
		);
		
		
		override public function xmlName():String{
			return "WebService";
		}
		
		override public function toolTipText():String{
			return "Calls a webService";
		}
		
		public function WSAction()
		{
			super();
		}
		
		override public function toXML(includeNull:Boolean):XML{
			var newXmlRow:XML= <WebService></WebService>
			super.buildXml(newXmlRow,includeNull);
			return newXmlRow;
		}

	}
}